package com.complex.spring.advance.service.annotation;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;

public class TestJsr250Annotation {
	
	private String a = null;
	//注入
	@Resource
	TestAutowireA testAutowireA;

	public void print() {
		if (testAutowireA != null) {
			System.out.println(a);
			testAutowireA.print();
		}
	}

	//初始化
	@PostConstruct
	public void setUp() {
		a= "test";
		System.out.println("this setUp");
	}

	//销毁
	@PreDestroy
	public void destroy() {
		System.out.println("this destroy");
	}
}
